Conversation
|
Thanks @tigerzhang for the pull request submission and contribution. Would you mind completing this CLA (contributor license agreement) form https://docs.google.com/forms/d/11hn-vBGhOZRunclC3NKmSX1cvQVrU--r0ldDLqasRIo/edit. |
|
signed |
|
Thx @tigerzhang. @OlegLoginov - could you please review the pull request? |
|
|
||
| KeyspaceMetadata* keyspace = NULL; | ||
| TableMetadata::Ptr table; | ||
| TableMetadata::Ptr table(NULL); |
There was a problem hiding this comment.
No need to init it by NULL due to default constructor of the object:
explicit SharedRefPtr(T* ptr = NULL)
So, please undo the change.
| } | ||
|
|
||
| table->add_index(IndexMetadata::from_row(index_name, buffer, row)); | ||
| if (table) { |
There was a problem hiding this comment.
Agree.
(Just for rare case when 'temp_table_name' is empty string.)
| @@ -2434,7 +2434,9 @@ void Metadata::InternalData::update_indexes(int protocol_version, const VersionN | |||
| table->clear_indexes(); | |||
There was a problem hiding this comment.
The main problem is here. If the table is not found the 'table_name' must be reset!
So, the line
if (!table) continue;
must be changed into:
if (!table) { table_name.clear(); continue; }
There is a chance meta table is uninitialized. A segment fault will occur.